{% extends 'base.html' %}

{% block body %}
<div class="row">
    <div class="span10">
        <div>
            <h1>Department</h1>
            <form action="/Organization/deptCreate/" method="post">
                <input type="text" name="L_deptCreate" placeholder="department-create">
                <button type="submit">create</button>
            </form>
            <form action="/Organization/deptQuery/" method="post">
                <input type="text" name="L_deptQuery"  placeholder="department-query">
                <button type="submit">query</button>
                </form>
            {% for d in L_deptList %}
                <ul>
                    <li>{{ d.deptName }}
                        <form action="/Organization/deptUpdate/{{ d.id }}/" method="post">
                            <input type="text" name="L_deptUpdate" placeholder="department-update"><br/>
                            <button type="button" onclick="delDept({{ d.id }})">delete</button>
                            <button type="submit">update</button>
                        </form>
                    </li>
                </ul>
            {% endfor %}
        </div>
    </div>
</div>
{% endblock %}

{% block fun %}
        function delDept(context){
            a = confirm('delete Department?');
            if (a){
                location.href="http://localhost:8000/Organization/deptRemove/"+context;
            }
        }
{% endblock %}
